package tedu.test.mapper;

import org.apache.ibatis.annotations.*;
import tedu.test.entity.Product;

import java.util.List;

@Mapper
public interface ProductMapper {

    @Select("select * from product where category_id=#{cid}")
    List<Product> selectByCid(int cid);


    @Select("select * from product")
    List<Product> select();

    @Delete("delete from product where id=#{id}")
    void deleteById(int id);

    @Insert("insert into product values(null,#{title},#{money},#{url},#{categoryId})")
    void insert(Product product);
}
